package com.red.star.wechat.data.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
 * @author AMGuo
 * @Description 转发日志
 * @date 2018/03/12 17:51
 */
@Data
@Table(name = "t_share_log")
public class ShareLog extends BaseEntity {

    /**
     * 分享者
     */
    @Column(name = "share_open_id")
    private String shareOpenId;

    /**
     * 接收者
     */
    @Column(name = "accept_open_id")
    private String acceptOpenId;

    /**
     * 分享类型：1为到人，2为到群 3app转发到人4app转发到群
     */
    @Column(name = "type")
    private Integer type;

    /**
     * 分享到群id
     * 微信群
     */
    @Column(name = "accept_group_id")
    private String acceptGroupId;

    /**
     * 页面id
     */
    @Column(name = "page_id")
    private Integer pageId;

    /**
     * 分享时间/接收时间
     */
    @Column(name = "time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;

    /**
     * 备注
     */
    @Column(name = "memo")
    private String memo;

    /**
     * 商户海报id
     */
    private String data;

    /**
     * 0：商户海报
     */
    private Integer dataType;

    /**
     * 分享者的employeeId
     */
    private Integer employeeId;

    /**
     * 针对type为3/4时的shopId
     */
    private Integer shopId;

    public ShareLog() {
    }

    public ShareLog(String shareOpenId, String acceptOpenId, Integer type, String acceptGroupId, Integer pageId, Date
            time, Integer dataType, String data) {
        this.shareOpenId = shareOpenId;
        this.acceptOpenId = acceptOpenId;
        this.type = type;
        this.acceptGroupId = acceptGroupId;
        this.pageId = pageId;
        this.time = time;
        this.dataType = dataType;
        this.data = data;
    }
}
